package com.stu.controller.student;

import com.stu.Dto.ClassJobApplicationDTO;
import com.stu.context.BaseContext;
import com.stu.result.Result;
import com.stu.serive.ClassInformationService;
import com.stu.vo.ClassJobApplicationVo;
import com.stu.vo.JobApplicationVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/student")
public class ClassInformationController {

    @Autowired
    private ClassInformationService classInformationService;

    /**
     * 添加学生申请班委信息
     * @return
     */
    @PostMapping("/classInformation")
    public Result insertClassJobApplication(@RequestBody ClassJobApplicationDTO classJobApplicationDTO){
        classInformationService.insertClassJobApplication(classJobApplicationDTO);
        return Result.success();
    }

    /**
     * 查询班委申请进度
     * @return
     */
    @GetMapping("/classInformation")
    private Result<List<ClassJobApplicationVo>> selectJobApplication(){
        return Result.success(classInformationService.selectJobApplication());
    }
}
